package com.isdust.jy.mbank;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;

import com.isdust.jy.mbank.activity.Index;
import com.isdust.jy.mbank.activity.Initial;

/**
 *
 * Created by zor on 2016/10/8.
 */

public class AppStart extends Activity{
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        // 防止第三方跳转时出现双实例
//        Activity aty = AppStack.getActivity(MainActivity.class);
//        if (aty != null && !aty.isFinishing()) {
//            finish();
//        }

        setContentView(R.layout.app_start);
        //延时八秒实现跳转到主页面
        findViewById(R.id.app_start_view).postDelayed(new Runnable() {
            @Override
            public void run() {
                redirectTo();
            }
        }, 800);
    }

    @Override
    protected void onResume() {
        super.onResume();
    }

    /**
     * 跳转到...
     */
    private void redirectTo() {
        //在这里需要加一个判断，判断进入的界面！！！
        Intent intent = new Intent(this, Initial.class);
        startActivity(intent);
        finish();
    }
}
